﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kristall.Screens;
using Kristall.Engine;

namespace Kristall.Editor.Commands
{
    public class DeleteCommand : ICommand
    {
        AABB _deleted;
        Level _level;

        public DeleteCommand(Level level, AABB toDelete)
        {
            _level = level;
            _deleted = toDelete;
        }

        public bool Execute()
        {
            if (_deleted != null)
            {
                _deleted.RemoveFromLevel();
                return true;
            }

            return false;
        }

        public bool Undo()
        {
            _deleted.AddToLevel();
            return true;
        }

        public string Name
        {
            get { return "Delete"; }
        }
    }
}
